﻿using eGrid_App;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Windows;
using System.Windows.Markup;

namespace eGrid_Test
{
    
    
    /// <summary>
    ///This is a test class for My_ApplicationTest and is intended
    ///to contain all My_ApplicationTest Unit Tests
    ///</summary>
    [TestClass()]
    public class My_ApplicationTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for My_Application Constructor
        ///</summary>
        [TestMethod()]
        public void My_ApplicationConstructorTest()
        {
            Window startupWindow = new Window();
            My_Application target = new My_Application(startupWindow);
            
            // nothing to test really
        }

        /// <summary>
        ///A test for My_Application_Loaded
        ///</summary>
        [TestMethod()]
        [DeploymentItem("eGrid_App.exe")]
        public void My_Application_LoadedTest()
        {
            Window param0 = new Window();
            My_Application_Accessor target = new My_Application_Accessor(param0);
            object sender = null;
            RoutedEventArgs e = null;
            target.My_Application_Loaded(sender, e);

            // Check that layoutroot has the GisInterfaceMgr instance as a child
            Assert.AreEqual(target.LayoutRoot.Children.Count, 1); // Will this pass??            
        }

        /// <summary>
        ///A test for getMainWindow
        ///</summary>
        [TestMethod()]
        public void getMainWindowTest()
        {
            Window startupWindow = new Window();
            My_Application target = new My_Application(startupWindow);
            Assert.AreEqual(target.getMainWindow(), startupWindow);            
        }
    }
}
